Home

Computer science

'

Research the game Bulgarian Solitaire, make sure you understand it completely.
Now write the outline of a Class called BulgarianSolitaire.
Remember, what does this class need to "know" and what does it need to "do"?
I want you to write pseudo code for how this Class can play Bulgarian Solitaire with 45 \ufeffcards. What is a triangular number???
This is a perfect opportunity to use Arrays and/or ArrayLists. Figure out how many you need. Research what an ArrayList is.
Figure out how you\'ll display every turn/iteration of this game. Simple print statements with asterisks is fine. Or some other way is OK too.
here is a sample output, starting from 4 \ufeffpiles:
7 11 23 4
-------------
3 4 6 10 22
2 3 5 5 9 21
1 2 4 4 6 8 20
1 3 3 5 7 7 19
2 2 4 6 6 7 18
1 1 3 5 5 6 7 17
2 4 4 5 6 8 16
1 3 3 4 5 7 7 15
2 2 3 4 6 6 8 14
1 1 2 3 5 5 7 8 13
1 2 4 4 6 7 9 12
1 3 3 5 6 8 8 11
2 2 4 5 7 7 8 10
1 1 3 4 6 6 7 8 9
2 3 5 5 6 7 8 9
1 2 4 4 5 6 7 8 8
1 3 3 4 5 6 7 7 9
2 2 3 4 5 6 6 8 9
1 1 2 3 4 5 5 7 8 9
1 2 3 4 4 6 7 8 10
1 2 3 3 5 6 7 9 9
1 2 2 4 5 6 8 8 9
1 1 3 4 5 7 7 8 9
2 3 4 6 6 7 8 9
1 2 3 5 5 6 7 8 8
1 2 4 4 5 6 7 7 9
1 3 3 4 5 6 6 8 9
2 2 3 4 5 5 7 8 9
1 1 2 3 4 4 6 7 8 9
1 2 3 3 5 6 7 8 10
1 2 2 4 5 6 7 9 9
1 1 3 4 5 6 8 8 9
2 3 4 5 7 7 8 9
1 2 3 4 6 6 7 8 8
1 2 3 5 5 6 7 7 9
1 2 4 4 5 6 6 8 9
1 3 3 4 5 5 7 8 9
2 2 3 4 4 6 7 8 9
1 1 2 3 3 5 6 7 8 9
1 2 2 4 5 6 7 8 10
1 1 3 4 5 6 7 9 9
2 3 4 5 6 8 8 9
1 2 3 4 5 7 7 8 8
1 2 3 4 6 6 7 7 9
1 2 3 5 5 6 6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